/ Assembly List / LJCDBDataAccess / DbDataAccess / ExecuteClientSql

Namespace - LJCDBDataAccess


Returns

The result XML message.

Syntax

C#
private DbResult ExecuteClientSql()

Executes a "Non-Query" client SQL statement. (E)

Remarks

This method is called from the Execute() method if the DbRequest.QueryType is "ExecuteSql".

Example

C#
// Execute a non-query SQL statement.
private static void ExecuteClientSql(DbDataAccess dbDataAccess
  , DbColumns dataDefinition)
{
  StringBuilder builder = new StringBuilder(64);
  builder.AppendLine("update PersonTest");
  builder.AppendLine("set Name = 'TestNameUpdated'");
  builder.AppendLine("where Name = 'TestName'");
  string sql = builder.ToString();

  DbRequest dbRequest = new DbRequest()
  {
    ClientSql = sql
    QueryType = QueryType.ExecuteSql.ToString()",
    TableName = "PersonTest",
  };
  DbResult dbResult = dbDataAccess.Execute(dbRequest);
    
  if (dbResult != null)
  {
    string sqlStatement = dbResult.ExecutedSql;
    int affectedCount = dbResult.AffectedRecords;
  }
}